package cn.jack.javalib.player;

/**
 * Created by chengyinggen on 2019/2/26.
 */
public class StopPlay extends PlayerState {

    public StopPlay(IPlayer mPlayer) {
        super(mPlayer);
    }

    @Override
    public void handle(int action) {
        switch (action) {
            case PLAY:
                mPlayer.play();
                mPlayer.setState(new PlayState(mPlayer));
                break;
            case PAUSE:
                mPlayer.pause();
                mPlayer.setState(new PauseState(mPlayer));
                break;
            default:
                throw new IllegalArgumentException("error");
        }
    }
}
